package com.xbongbong.sys.model.impl;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.sys.domain.dao.PriceProductSetDao;
import com.xbongbong.sys.domain.entity.PriceProductSetEntity;
import com.xbongbong.sys.domain.entity.PriceSetEntity;
import com.xbongbong.sys.model.PriceProductSetModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

;

/**
 * @author bomfish
 */
@Service("priceProductSetModel")
public class PriceProductSetModelImpl implements PriceProductSetModel {
    public static final Logger LOGGER = LoggerFactory.getLogger(PriceProductSetModelImpl.class);
    @Resource
    private PriceProductSetDao priceProductSetDao;

    @Override
    public Integer insert(PriceProductSetEntity entity) {
        return priceProductSetDao.insert(entity);
    }

    @Override
    public void insertBatch(List<PriceProductSetEntity> list) {
        priceProductSetDao.insertBatch(list);
    }

    @Override
    public List<PriceProductSetEntity> findEntitys(Map<String, Object> param) {
        return priceProductSetDao.findEntities(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return priceProductSetDao.getEntitiesCount(param);
    }

    @Override
    public Integer update(PriceProductSetEntity entity) {
        return priceProductSetDao.update(entity);
    }

    @Override
    public PriceProductSetEntity getByKey(Long key, String corpid) {
        return priceProductSetDao.getByKey(key, corpid);
    }

    @Override
    public void deleteByPriceId(Long priceId, String corpid) {
        priceProductSetDao.deleteByPriceId(priceId, corpid);
    }

    @Override
    public List<PriceProductSetEntity> getByPriceId(Long priceId, String corpid) {
        return priceProductSetDao.getByPriceId(priceId, corpid);
    }

    @Override
    public List<PriceProductSetEntity> findEntitysWithoutSub(Map<String, Object> param) {
        return priceProductSetDao.findEntities(param);
    }

    @Override
    public void updateBatch(List<PriceProductSetEntity> updatePriceProductSetList, String corpid) {
        priceProductSetDao.updateBatch(updatePriceProductSetList, corpid);
    }

    @Override
    public void deleteByKey(Long id, String corpid) {
        priceProductSetDao.deleteByKey(id, corpid);
    }

    @Override
    public List<Long> getAllProduct(String corpid, Long dataId) {
        return priceProductSetDao.getAllProduct(corpid, dataId);
    }

    @Override
    public void deleteByProductId(Long dataId, Long productId, String corpid) {
        priceProductSetDao.deleteByProductId(dataId, productId, corpid);
    }
}
